package labox.innovation.gameserver.network.clientpackets;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import labox.innovation.config.Config;
import labox.innovation.gameserver.datatables.PlayerTemplateTable;
import labox.innovation.gameserver.model.base.ClassId;
import labox.innovation.gameserver.network.serverpackets.NewCharacterSuccess;

/**
 * This class ...
 *
 * @version $Revision: 1.3.4.5 $ $Date: 2005/03/27 15:29:30 $
 */
public final class NewCharacter extends L2GameClientPacket {
	private static final String _C__0E_NEWCHARACTER = "[C] 0E NewCharacter";

	private static final Logger _log = LoggerFactory.getLogger(NewCharacter.class.getName());

	@Override
	protected void readImpl() {
	}

	@Override
	protected void runImpl() {
		if (_log.isDebugEnabled())
			_log.debug("CreateNewChar:{}",getClient());

		NewCharacterSuccess ct = new NewCharacterSuccess();

		for (int j = -1; ++j < ClassId.values().length;) {
			ct.addChar(PlayerTemplateTable.getInstance().getTemplate(ClassId.values()[j].getId()));
			ct.addChar(PlayerTemplateTable.getInstance().getTemplate(ClassId.values()[j].getId()+1));
		}

		sendPacket(ct);
	}

	/* (non-Javadoc)
	 * @see labox.innovation.gameserver.clientpackets.ClientBasePacket#getType()
	 */
	@Override
	public String getType() {
		return _C__0E_NEWCHARACTER;
	}
}
